package com.xiaoshuidi.cloud.module.finance.controller.admin.finance.vo.reconciliation;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;

@Schema(description = "管理后台 - 财务对账 Response VO")
@Data
public class FinanceReconciliationRespVO {

    private Left left;
    private Right right;
    @Schema(description = "结账结果")
    private Boolean success;
    private String remark;

//    public Boolean getSuccess() {
//        return right != null && right.getTotalAmount() != null
//                && left.getTotalAmount().compareTo(right.getTotalAmount()) == 0;
//    }

    @Data
    public static class Left {
        @Schema(description = "账单编号")
        private String roomRentOrderNo;
        @Schema(description = "支付编号")
        private String merchantOrderId;
        @Schema(description = "账单金额")
        private BigDecimal totalAmount;
        @Schema(description = "租客")
        private String renter;
    }

    @Data
    public static class Right {
        @Schema(description = "交易流水号")
        private String flowNo;
        @Schema(description = "支付方式")
        private String payMethod;
        @Schema(description = "支付金额")
        private BigDecimal totalAmount;
        @Schema(description = "实际到账金额")
        private BigDecimal settleAmount;
        @Schema(description = "通道费金额")
        private BigDecimal serviceFee;
    }
}
